package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloMvcController {
    @RequestMapping("/helloworld")
    public  String helloWorld (Model model) throws Exception{
        model.addAttribute("mav","哈哈");
        return "example/hello";
    }

    @RequestMapping("/helloworld2")
    private ModelAndView helloworld2() throws Exception{
        ModelAndView mav = new ModelAndView("example/hello");
        mav.addObject("mav","<ul><li>html</li></ul>");
        return mav;
    }

}
